Skip to content

Add missing subtype checks for table, memory, and global fields#194

Merged
fibonacci1729 merged 1 commit intobytecodealliance:mainfrom
sumleo:fix/subtype-checker-missing-checks
Feb 17, 2026
Merged

Add missing subtype checks for table, memory, and global fields#194
fibonacci1729 merged 1 commit intobytecodealliance:mainfrom
sumleo:fix/subtype-checker-missing-checks

Conversation

@sumleo
Copy link
Copy Markdown
Contributor

@sumleo sumleo commented Feb 12, 2026

Summary

  • The subtype checker was ignoring several fields when comparing core WebAssembly extern types:
    • Table: table64 and shared flags were bound but unused (prefixed with _)
    • Memory: page_size_log2 was bound but unused
    • Global: shared flag was bound but unused
  • This meant two types differing only in these fields would incorrectly pass the subtype check
  • Added the missing comparisons and renamed bindings to remove the _ prefix

Test plan

  • Added 4 unit tests in checker.rs: mismatched_table64_is_rejected, mismatched_table_shared_is_rejected, mismatched_memory_page_size_log2_is_rejected, mismatched_global_shared_is_rejected
  • All existing tests pass (cargo test --workspace)

The subtype checker was ignoring several fields when comparing core
WebAssembly types:

- Table: table64 and shared flags were bound but unused (prefixed with _)
- Memory: page_size_log2 was bound but unused
- Global: shared flag was bound but unused

This meant two types differing only in these fields would incorrectly
pass the subtype check. Added the missing comparisons and unit tests
for each case.
@fibonacci1729 fibonacci1729 merged commit 1ac82c6 into bytecodealliance:main Feb 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants